<!DOCTYPE html>
<!-- 
┏┓╋┏┓╋┏┓╋╋╋╋╋╋┏━┓
┃┃╋┃┃╋┃┃╋╋╋╋╋╋┃┏┛
┃┃╋┃┣━┛┣┳━━┳━┳┛┗┳━━┳━┓┏━━┓
┃┃╋┃┃┏┓┣┫┏┓┃┏╋┓┏┫┏┓┃┏┓┫┏┓┃
┃┗━┛┃┗┛┃┃┏┓┃┃┃┃┃┃┏┓┃┃┃┃┗┛┃
┗━━━┻━━┻┻┛┗┻┛┗┻┛┗┛┗┻┛┗┻━┓┃
╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┏━┛┃
╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗━━┛

http://udfang.com
Work with us? We're a fun bunch!  http://udfang.com/about
-->
<html lang="zh-CN">

<head>
    <title><?php echo $data->seo_title;?></title>
    <meta content='IE=Edge' http-equiv='X-UA-Compatible'>
    <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimal-ui" />
    <meta content='<?php echo $data->seo_keywords;?>' name='keywords'>
    <meta content='<?php echo $data->seo_description;?>' name='description'>
    <link rel="stylesheet" href="/assets/css/topic/reset.css" />
    <script src="/assets/js/building/jquery-1.11.1.min.js"></script>
    <script type="text/javascript">
        var oHtml = document.documentElement;
        getFont();
        window.onresize = function(){
            getFont();
        }
        function getFont(){
            var screenWidth = oHtml.clientWidth;
            if(screenWidth <= 320){
                oHtml.style.fontSize = '8px';
            }else if(screenWidth >= 640){
                oHtml.style.fontSize = screenWidth/(540/12)+'px';
            }else{
                oHtml.style.fontSize = screenWidth/(540/16)+'px';
            }   
        }
    </script>
</head>
<body>
    <?php echo $data->content;?>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
    var targetSharePic = "<?php echo $data->absolute_url_news;?>";
    var imgs = '';
    if( targetSharePic != '' ){
        imgs = targetSharePic;
    }else{
        imgs = document.body.getElementsByTagName("img")[0].src;
    }
    console.log(imgs);
    // 如果发现在 Android 不能分享自定义内容，请到官网下载最新的包覆盖安装，Android 自定义分享接口需升级至 6.0.2.58 版本及以上。
    wx.config({
        appId: '<?php echo $signPackage["appId"];?>',
        timestamp: <?php echo $signPackage["timestamp"];?>,
        nonceStr: '<?php echo $signPackage["nonceStr"];?>',
        signature: '<?php echo $signPackage["signature"];?>',
        jsApiList: [
            // 所有要调用的 API 都要加到这个列表中
            'checkJsApi',
            'openLocation',
            'getLocation',
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ'
        ]
    });
    wx.ready(function () {
        // 分享给朋友
        wx.onMenuShareAppMessage({
                title: '<?php echo $data->seo_title;?>',
                desc: '<?php echo $data->seo_description;?>',
                link: '<?php echo $data->linkto;?>', // 分享链接
                imgUrl: imgs,
                trigger: function (res) {
                    // alert('用户点击发送给朋友');
                },
                success: function (res) {
                    // alert('已分享');
                },
                cancel: function (res) {
                    // alert('已取消');
                },
                fail: function (res) {
                    // alert(JSON.stringify(res));
                }
            });
        //分享到朋友圈
        wx.onMenuShareTimeline({
            title: '<?php echo $data->seo_title;?>',
            desc: '<?php echo $data->seo_description;?>',
            link: '<?php echo $data->linkto;?>', // 分享链接
            imgUrl: imgs,
            trigger: function (res) {
            // alert('用户点击分享到朋友圈');
            },
            success: function (res) {
            // alert('已分享');
            },
            cancel: function (res) {
            // alert('已取消');
            },
            fail: function (res) {
            // alert(JSON.stringify(res));
            }
        });
        //分享到QQ
        wx.onMenuShareQQ({
            title: '<?php echo $data->seo_title;?>',
            desc: '<?php echo $data->seo_description;?>',
            link: '<?php echo $data->linkto;?>', // 分享链接
            imgUrl: imgs,
            success: function () { 
               // 用户确认分享后执行的回调函数
            },
            cancel: function () { 
               // 用户取消分享后执行的回调函数
            }
        });
    });
    </script>
    <?php $this->load->view('../home/analytics') ?>
</body>

</html>
